package com.lanyou.esb.datadictionary;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

/**
 * 存储转发状态<br>
 * 描述：<br>
 * 1:转发失败;2:转发成功;3:正在转发;
 * 
 * @author Davey.wu
 */
public enum ForwardStatus {
	FORWARDFAILD("1"), FORWARDSUCCESS("2"), FORWARDING("3");

	public static final String TypeCode = "20019";

	public final String ValueCode;

	private ForwardStatus(String code) {
		this.ValueCode = code;
	}

	public static ForwardStatus get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (ForwardStatus type : ForwardStatus.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
